FROM project:latest

ADD . /app

WORKDIR /app/svelte-server/main
RUN go generate ./...
RUN go build .

WORKDIR /app/svelte-vite
RUN npm install && npm run build

WORKDIR /app

EXPOSE 8082

# ENTRYPOINT ['./entrypoint.sh']
# CMD ./entrypoint.sh

CMD (cd svelte-server/main && nohup ./main &) && (cd -) && (cd svelte-vite && nohup npm run dev &) && tail -f > /dev/null
